// addEvent
function addEvent(obj,type,fn)
{
	var on_type = "on"+type;
	if(obj.on_type=="undefined")
	{
		obj.on_type = function()
		{
		}
	}
    if(obj.addEventListener)
    	obj.addEventListener(type,fn,false);
    else if(obj.attachEvent){
        obj["e"+type+fn]=fn;
        obj[type+fn]=function(){obj["e"+type+fn](window.event);}
        obj.attachEvent("on"+type,obj[type+fn]);
    }
}
//addEvent(window,onload,);